package websocket.listener;


import lombok.extern.slf4j.Slf4j;
import websocket.service.ChuanKouService;
import websocket.util.DigitalTrans;

/**
 * MyListener 航向信息、最佳位置信息Listener
 * @author nieruijie
 * @date 2022/5/10 0:31
 */
@Slf4j
public class MyListener extends PortListener {

    @Override
    public void onReceive(byte[] data) {
        String needData = DigitalTrans.printHexString(data);
        logger.info(needData);
        // 处理航向信息、最佳位置信息串口数据
//        ChuanKouService.chuLiChuanKouHangXiangData(needData);
    }

    @Override
    public void onReadException(Exception e) {
        System.out.println("发生异常: " + e.getMessage());
    }
}
